﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Linq.Expressions;
using System.Collections.ObjectModel;

namespace WoWRealmlistChanger.Model
{
    class ViewModelBase : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        protected void RaisePropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }

        protected void RaisePropertyChanged<TResult>(Expression<Func<TResult>> propertyExpression)
        {
            RaisePropertyChanged(((MemberExpression)propertyExpression.Body).Member.Name);
        }
    }


    class StarterModel : ViewModelBase
    {
        
        private string m_TxtBc;

        public string TxtBc
        {
            get
            {
                return m_TxtBc;
            }
            set
            {
                if (m_TxtBc != value)
                {
                    this.m_TxtBc = value;
                    RaisePropertyChanged(() => TxtBc);
                }
            }
        }

        
        private string m_TxtWotlk;

        public string TxtWotlk
        {
            get
            {
                return m_TxtWotlk;
            }
            set
            {
                if (m_TxtWotlk != value)
                {
                    this.m_TxtWotlk = value;
                    RaisePropertyChanged(() => TxtWotlk);
                }
            }
        }


        private ObservableCollection<string> m_LstBc;

        public ObservableCollection<string> LstBc
        {
            get
            {
                return m_LstBc;
            }
            set
            {
                if (m_LstBc != value)
                {
                    this.m_LstBc = value;
                    RaisePropertyChanged(() => LstBc);
                }
            }
        }


        private ObservableCollection<string> m_LstWotlk;

        public ObservableCollection<string> LstWotlk
        {
            get
            {
                return m_LstWotlk;
            }
            set
            {
                if (m_LstWotlk != value)
                {
                    this.m_LstWotlk = value;
                    RaisePropertyChanged(() => LstWotlk);
                }
            }
        }

        
        private bool m_ChkDeleteCache;

        public bool ChkDeleteCache
        {
            get
            {
                return m_ChkDeleteCache;
            }
            set
            {
                if (m_ChkDeleteCache != value)
                {
                    this.m_ChkDeleteCache = value;
                    RaisePropertyChanged(() => ChkDeleteCache);
                }
            }
        }

        
        private bool m_ChkClose;

        public bool ChkClose
        {
            get
            {
                return m_ChkClose;
            }
            set
            {
                if (m_ChkClose != value)
                {
                    this.m_ChkClose = value;
                    RaisePropertyChanged(() => ChkClose);
                }
            }
        }

        
        private int m_LstIndexWotlk;

        public int LstIndexWotlk
        {
            get
            {
                return m_LstIndexWotlk;
            }
            set
            {
                if (m_LstIndexWotlk != value)
                {
                    this.m_LstIndexWotlk = value;
                    RaisePropertyChanged(() => LstIndexWotlk);
                }
            }
        }

        
        private int m_LstIndexBc;

        public int LstIndexBc
        {
            get
            {
                return m_LstIndexBc;
            }
            set
            {
                if (m_LstIndexBc != value)
                {
                    this.m_LstIndexBc = value;
                    RaisePropertyChanged(() => LstIndexBc);
                }
            }
        }

        
        private string m_LstBcSelectedValue;

        public string LstBcSelectedValue
        {
            get
            {
                return m_LstBcSelectedValue;
            }
            set
            {
                if (m_LstBcSelectedValue != value)
                {
                    this.m_LstBcSelectedValue = value;
                    RaisePropertyChanged(() => LstBcSelectedValue);
                }
            }
        }

        
        private string m_LstWotlkSelectedValue;

        public string LstWotlkSelectedValue
        {
            get
            {
                return m_LstWotlkSelectedValue;
            }
            set
            {
                if (m_LstWotlkSelectedValue != value)
                {
                    this.m_LstWotlkSelectedValue = value;
                    RaisePropertyChanged(() => LstWotlkSelectedValue);
                }
            }
        }
        
        
        
        
        
        
        
        
        
    }
}
